package sanrenxing.dayEnd.backRepertoryTotal.dao;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.springframework.stereotype.Repository;
import sanrenxing.dayEnd.backRepertoryTotal.domain.Days;

import java.util.List;

@Repository
public interface DaysD {

    @Insert("insert into holidays values(#{id},to_date(#{holidaydate},'yyyy-MM-dd'),to_date(#{enddate},'yyyy-MM-dd'),#{days})")
    @SelectKey(statement = "select holidayss.nextval from dual", keyColumn = "id",keyProperty ="id" , before =true , resultType = Integer.class)
    public int add(Days us);
    @Delete("delete from holidays where id=${id}")
    public int del(int us);
    @Select("select * from holidays")
    public List<Days> all();
    @Select("select count(*) from dateTest where dates=to_date('${dayDate}','yyyy-MM-dd')")
    public int selectDate(String dayDate);
}
